﻿namespace DBMock.Builders
{
    /// <summary>
    /// bool builder
    /// </summary>
    public class BoolBuilder : Builder
    {
        //true概率
        private int truePercent;

        /// <summary>
        /// 初始化BoolBuilder
        /// </summary>
        /// <param name="seed">随机数种子</param>
        /// <param name="truePercent">true概率</param>
        public BoolBuilder(int seed, int truePercent)
            : base(seed)
        {
            this.truePercent = truePercent;
        }

        public override object Build()
        {
            return random.Next(100) < truePercent;
        }
    }
}
